{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "  AveRooms  percentage\n",
      "0      4-5    0.535901\n",
      "1      6-7    0.349516\n",
      "2      <=3    0.057171\n",
      "3      8-9    0.044816\n",
      "4      +10    0.012597\n"
     ]
    }
   ],
   "source": [
    "# Case: California Housing price EXERCISE - 1\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "from sklearn.datasets import fetch_california_housing\n",
    "\n",
    "cal = fetch_california_housing()\n",
    "cal_df = pd.DataFrame(data=np.c_[cal['data'], cal['target']], columns=list(cal['feature_names']) + ['target'])\n",
    "# Now I round the Average Number of Bedrooms (for a block) to the neareat integer and 10+ bedrooms go in their own category\n",
    "cal_df['AveRoomsRounded'] = cal_df['AveRooms'].round(decimals=0).astype(int)\n",
    "\n",
    "# And now I categorize based on their range\n",
    "cal_df.loc[cal_df.AveRoomsRounded > 9, 'AveRoomsBin'] = '+10'\n",
    "cal_df.loc[(cal_df.AveRoomsRounded > 7) & (cal_df.AveRoomsRounded < 10), 'AveRoomsBin'] = '8-9'\n",
    "cal_df.loc[(cal_df.AveRoomsRounded > 5) & (cal_df.AveRoomsRounded < 8), 'AveRoomsBin'] = '6-7'\n",
    "cal_df.loc[(cal_df.AveRoomsRounded > 3) & (cal_df.AveRoomsRounded < 6), 'AveRoomsBin'] = '4-5'\n",
    "cal_df.loc[cal_df.AveRoomsRounded < 4, 'AveRoomsBin'] = '<=3'\n",
    "\n",
    "#Uncommment the print functions below to see more about the data\n",
    "#print(cal_df['AveRoomsBin'].value_counts(normalize=True))\n",
    "#print(cal_df['AveRoomsRounded'].value_counts(normalize=True))\n",
    "#print(cal.DESCR) #good for any scikit learn dataset\n",
    "\n",
    "cal_df_binned = cal_df['AveRoomsBin'].value_counts(normalize=True).rename_axis('AveRooms').reset_index(name='percentage')\n",
    "print(cal_df_binned)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "''"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAALEAAACxCAYAAACLKVzFAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/NK7nSAAAACXBIWXMAAAsTAAALEwEAmpwYAAAbc0lEQVR4nO2deXwUVbbHf1W9Zu0shARCSAFZOoFmDYugkuEREXsQDOjgMrigzjiOznN7tsygcZ3WccZZnvN8ivKCC1GBUaFhAEVAYEQBCQESFkkDIQkEsm+91X1/dMMQyNKdrrW7vp9Pffik+946J+HXt2/de+45FCEECgpyhhbbAQWFYFFErCB7FBEryB5FxAqyRxGxguxRRKwgexQRK8geRcQKskcRsYLsUUSsIHsUESvIHkXECrJHEbGC7FFErCB7FBEryB5FxAqyRxGxguxRRKwgexQRK8geRcQKskcRsYLsUUSsIHvUYjsgRxiLTQ0gF0A6gNRuriQAWgDqTCd9aF67biwAF4AOAK20x3Es/5vH3QCqAZzx/XsSwP6civKzAv86skcRsR8wFtswAJMATPZd4wBE+NldC0Dnu6IBJFGEdALI6a5xuTGnGsBe3/UvADtzKsrbgvoFQhxFxN3AWGzRAH4KoBDAdAADuby/ytPZmygH+645vp9d5cacPQC2AvgSwLacinIPl/7IHUXEPhiLzQDgZgALANwAQM+XLY273RFIcwDX+K5nAJwtN+Z8AuCjnIryb/nwT26EtYgZi42Gd8R7EMBMeL/6eUfrbHEH0T0ZwCMAHtl0bc7aJx5QfwfgvbK7y6q58U5+hKWIfaPuAwB+BWCY0Pa1jkZOEuD9Yyo9CMCLAIpMxaa1AH5fdnfZd1zcW06ElYgZiy0FwGMAfgkgViw/9I5GVbD38FCo3ZVDjff9qAIwD8A8U7FpM4CXyu4u2x6sDbkQFiJmLLZYAEvh/RrWiewOdI6GoKct+4dTFS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wKYB6DHg5t8s4dkZxGCdoqCr6A5Bagj2hARdwGRifVQaTxi+SY1wm460Rt2q5nYrebddqt5id1qzgWQBeBJePNgCJqC1gMVqSJJ6wH8AcBNzsiBpzHQWIGYlDopCvi9996Lz8jIGEnT9ITt27dHXv7eM888kzJ06NBRDMOMWr16dSzXtpWRuBd8u4B/9F1gLLZ0AHkARvuukfBOP4JJUdoB4BS8JYNPAjgE4DsAP6S9cPzfmfRLS7tsRb/5yy0TgrB5FQ+/NWOvv23XrVsXs3z58sTVq1fbL742duzYjtWrVx9/4IEHmMvb7t27V79mzZqEI0eOHDp58qSmoKAga+7cuQfVau6kp4g4AHwhoCcBrL78dcZiiwSQfNmVAiAOAAvvkaorr2bffU7ZrWZpH9X3k/Hjx3dbumLVqlVxhYWF9REREcRoNDrT09MdW7dujZo5cyZnqyeKiDnAbjW3A6j0XQqXcebMGe2UKVMuRRgOHjzY6QvNVESsIDyjR482Op1Our29nW5qalIbjcZcAHj55Zer5s+fL04cNBQRKwTAgQMHKoDu58Q9kZqa6rw8KL66ulqblpbm3xq4nyirEwq8Mn/+/MY1a9YkdHR0UBUVFVq73a7Pz8/ndDdREbECJ6xYsSIuOTl59P79+6NuueWWzGuvvTYTAPLy8jrnzZtXn5WVNfLGG2/M+tOf/nSSy5UJIMRDMUOJ0tJS+5gxYySbD41LlFBMhbBDEbGC7FFErCB7FBHLB5Zl2ZAPV/P9jgGd9lZELB8O1tXVGUJZyCzLUnV1dQYABwPpp2x2yAS3231/bW3tstra2lEI3cGHBXDQ7XbfH0gnZYlNQfaE6idaIYxQRKwgexQRK8geRcQKskcRsYLsUUSsIHsUESvIHkXECrJHEbGC7FFErCB7/h/q3Y//8V+6lwAAAABJRU5ErkJggg==",
      "text/plain": [
       "<Figure size 216x216 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "from fpdf import FPDF\n",
    "import matplotlib\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "fig, ax = plt.subplots()\n",
    "fig.set_size_inches(3, 3)\n",
    "wedges, autotexts = ax.pie(cal_df_binned['percentage'], startangle=90)\n",
    "plt.legend(wedges, cal_df_binned['AveRooms'], loc='lower right')\n",
    "plt.savefig('cal_df_binned.png')\n",
    "\n",
    "pdf=FPDF(format='letter')\n",
    "pdf.add_page() #always needed\n",
    "pdf.set_font('arial', 'B', 11)\n",
    "pdf.cell(60)\n",
    "pdf.cell(75, 10, 'California Housing Room Numbers per House', 0, 2, 'C')\n",
    "pdf.cell(90, 10, '', 0, 2, 'C')\n",
    "\n",
    "columnNameList = list(cal_df_binned.columns)\n",
    "for header in columnNameList[:-1]:\n",
    "  pdf.cell(35, 10, header, 1, 0, 'C')\n",
    "pdf.cell(35, 10, columnNameList[-1], 1, 1, 'C')\n",
    "pdf.set_font('arial', '', 11)\n",
    "\n",
    "for i in range(0, len(cal_df_binned)):\n",
    "  pdf.cell(60)\n",
    "  pdf.cell(35, 10, cal_df_binned['AveRooms'][i], 1, 0, 'C')\n",
    "  pdf.cell(35, 10, str(round(100 * cal_df_binned['percentage'][i], 2)), 1, 1, 'C')\n",
    "pdf.cell(90, 10, '', 0, 2, 'C')\n",
    "pdf.cell(55, 10, '', 0, 0, 'C')\n",
    "\n",
    "#insert chart\n",
    "pdf.image('../PDFGenerator/cal_df_binned.png', x = None, y = None, w=0, h=0, type='', link='')\n",
    "pdf.output('../PDFGenerator/cal_df_binned.pdf', 'F')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Open</th>\n",
       "      <th>High</th>\n",
       "      <th>Low</th>\n",
       "      <th>Close</th>\n",
       "      <th>Adj Close</th>\n",
       "      <th>Volume</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Date</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "Empty DataFrame\n",
       "Columns: [Open, High, Low, Close, Adj Close, Volume]\n",
       "Index: []"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sp500_history"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "import yfinance as yf\n",
    "import pandas as pd\n",
    "\n",
    "goog = yf.Ticker('goog')\n",
    "\n",
    "end_date = pd.Timestamp.today()\n",
    "start_date = end_date - pd.Timedelta(days=10*365)\n",
    "data_history = goog.history(start=start_date, end=end_date)\n",
    "\n",
    "data_history = data_history.drop(columns=['Dividends', 'Stock Splits'])\n",
    "\n",
    "data_history['Close_200ma'] = data_history['Close'].rolling(200).mean()\n",
    "\n",
    "data_history_summary = data_history.describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAgkAAADQCAYAAACNzPI2AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/NK7nSAAAACXBIWXMAAAsTAAALEwEAmpwYAAA+/ElEQVR4nO3dd3hUZfbA8e9JryQEQg2hhd4hAiIggoViFyu2VZe1r21dsfzUXQvqrn1RUVTsKPZGEQHp0kvonYQa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EWOfjGBCRBvbPROByrI611R6Dff9vgBuMMa6JyGKgjYi0tGt3rrHv4csYTlh1xVDOfXwZwwm/V6oaqro6N9TEB9Afq3psFVY16AqsNtN6WB0AN2H1xo6zz2+E9U01E8iwt+sAXYHl9n3WAP/n6xhK3HMQVRvdUF2/h1ZYPcdXAinAY/74PQDdgSX2vb7D7mXt4xgigYNAjL/+Lu1jT2O9Ca8BPgZC/RDDHKxEbSUwxIu/h/ewaioKz13icq/hWDUYW/Du32V5MXyO1Tck3/793OrLGMq6j49jOOH3Sn3UzIdOy6yUUkopj07r5gallFJKnThNEpRSSinlkSYJSimllPJIkwSllFJKeaRJglJKKaU80iRBKR8QEYdYK0amiLVC3oMiUu7/PxFpISLX+SpGpZQqSZMEpXwj2xjT3RjTCWuCmWHAkxVc0wLQJEEp5Tc6T4JSPiAix4wxUS77rbBmCqwPNMeaCKlwoaq7jTHzRWQh0AFr1cuJwOvAWKzJtEKB/xlj3vHZi1BK1TqaJCjlAyWTBLssA2gHHAWcxpgcEWkDfG6MSRaRQVjLMl9onz8aaGCMeUZEQoF5wJXGmG0+fClKqVokyN8BKKUIBt4Uke5YKyi2LeO884GuIjLS3o8B2mDVNCilVLXTJEEpP7CbGxxYq+o9CewDumH1E8op6zLgHmPMVJ8EqZSq9bTjolI+JiLxwNvAm8Zq74sB9hhjnMANQKB96lEg2uXSqcAd9pK+iEhbezVOpZTyCq1JUMo3wkVkBVbTQgFWR8XCJXnHAV+LyI3AFOC4Xb4KcIjISuBD4DWsEQ/L7KV9DwCX+iZ8pVRtpB0XlVJKKeWRNjcopZRSyiNNEpRSSinlkSYJSimllPJIkwSllFJKeaRJglJKKaU80iRBKaWUUh5pkqCUUkopj/4fmnmGWgvBO5kAAAAASUVORK5CYII=",
      "text/plain": [
       "<Figure size 534.75x216 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "import seaborn as sns\n",
    "sns.relplot(data=data_history[['Close', \\\n",
    "    'Close_200ma']], kind='line', height=3, aspect=2.0)\n",
    "plt.savefig('../PDFGenerator/chart.png')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "''"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "def output_df_to_pdf(pdf, df):\n",
    "    table_cell_width = 25\n",
    "    table_cell_height = 6\n",
    "    pdf.set_font('Arial', 'B', 8)\n",
    "    cols = df.columns\n",
    "    for col in cols:\n",
    "        pdf.cell(table_cell_width, table_cell_height, col, align='C', border=1)\n",
    "    pdf.ln(table_cell_height)\n",
    "    pdf.set_font('Arial', '', 10)\n",
    "    for row in df.itertuples():\n",
    "        for col in cols:\n",
    "            value = str(getattr(row, col))\n",
    "            pdf.cell(table_cell_width, table_cell_height, value, align='C', border=1)\n",
    "        pdf.ln(table_cell_height)\n",
    "from fpdf import FPDF\n",
    "pdf = FPDF()\n",
    "pdf.add_page()\n",
    "pdf.set_font('Arial', 'B', 16)\n",
    "pdf.cell(40, 10, 'Daily S&P 500 prices report')\n",
    "pdf.ln(20)\n",
    "pdf.image('chart.png')\n",
    "pdf.ln(20)\n",
    "data_history_pdf = data_history.reset_index()\n",
    "data_history_pdf['Date'] = data_history_pdf['Date'].astype(str)\n",
    "numeric_cols = data_history_pdf.select_dtypes(include='number').columns\n",
    "data_history_pdf[numeric_cols] = data_history_pdf[numeric_cols].round(2)\n",
    "output_df_to_pdf(pdf, data_history_pdf.tail(3))\n",
    "pdf.ln(20)\n",
    "data_history_summary_pdf = data_history_summary.reset_index()\n",
    "numeric_cols = data_history_summary_pdf.select_dtypes(include='number').columns\n",
    "data_history_summary_pdf[numeric_cols] = data_history_summary_pdf[numeric_cols].round(2)\n",
    "\n",
    "output_df_to_pdf(pdf, data_history_summary_pdf)\n",
    "# 3. Output the PDF file\n",
    "pdf.output('../PDFGenerator/fpdf_pdf_report.pdf', 'F')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.8.13 ('py38')",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.13"
  },
  "orig_nbformat": 4,
  "vscode": {
   "interpreter": {
    "hash": "da3096a4b2ddf6e3108983d9c4f8ed6b468b54d4f76a60924a980331cf3af984"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
